package casa.depesos.app.com.http.bean;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

import casa.depesos.app.com.http.BaseBean;

public class GetCodeBean extends BaseBean {

    @SerializedName("dataRecord")
    @Expose
    public Object data;

    private boolean showErr = true;

    public void setShowErr(boolean bo) {
        showErr = bo;
    }

    @Override
    public boolean showErrMsg() {
        return showErr;
    }

    @Override
    public boolean isValid() {
        boolean bo = super.isValid();
        if (bo && data == null) {
            data = "";
        }
        return bo;
    }

    public String getCode() {
        try {
            return Float.valueOf(data.toString()).intValue() + "";
        } catch (Throwable e) {
            return data.toString();
        }
    }
}
